package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by Administrator on 2017/6/10.
 */
@Entity
@Table(name = "discount", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class DiscountEntity extends IAcross
{
    private int id;
    private Integer loginId;
    private BigDecimal discount;
    public DiscountEntity()
    {
        super();
    }
    public DiscountEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "login_id")
    @GeneratedValue
    public Integer getLoginId() {
        return loginId;
    }

    public void setLoginId(Integer loginId) {
        this.loginId = loginId;
    }

    @Basic
    @Column(name = "discount")
    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DiscountEntity that = (DiscountEntity) o;

        if (id != that.id) return false;
        if (discount != null ? !discount.equals(that.discount) : that.discount != null) return false;
        if (loginId != null ? !loginId.equals(that.loginId) : that.loginId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (loginId != null ? loginId.hashCode() : 0);
        result = 31 * result + (discount != null ? discount.hashCode() : 0);
        return result;
    }
}
